<template>
  <view class="punch-instruction-wrapper">
    <view class="punch-instruction">
      <textarea
        v-model="text"
        auto-height
        class="punch-instruction-textarea"
        placeholder-class="punch-instruction-placeholder"
        placeholder="请输入外出打卡说明"
      />
    </view>
    <button class="punch-instruction-button" @click="confirm">保 存</button>
  </view>
</template>
<script>
export default {
  data() {
    return {
      text: ""
    };
  },
  methods: {
    confirm() {
      this.$store.commit("punchcard/updateInstruction", this.text);
      uni.redirectTo({
        url: `/punchcard/index`
      });
    }
  }
};
</script>
